#ifndef __GPIO_H
#define __GPIO_H
#include "uart1.h"

#define  Dely_time1   1
#define  Open_time  4
#define  Dl_time    10 

#define MY_SET_BIT (x,y)(x|=(1<<y))
#define MY_CLR_BIT (x,y)(x&=~(1<<y))

#define MY_CPL_BIT (x,y)(x^=(1<<y))
#define MY_GET_BIT (x,y)(x&=(1<<y))

#define SetBit(VAR,Place)         ( (VAR) |= (UINT08)((UINT08)1<<(UINT08)(Place)) )
#define ClrBit(VAR,Place)         ( (VAR) &= (UINT08)((UINT08)((UINT08)1<<(UINT08)(Place))^(UINT08)255) )
#define ChgBit(VAR,Place)         ( (VAR) ^= (UINT08)((UINT08)1<<(UINT08)(Place)) )
#define ValBit(VAR,Place)         ((UINT08)(VAR) & (UINT08)((UINT08)1<<(UINT08)(Place)))


extern UINT08 Plate_address1;
extern UINT16 tim3_tim;


extern UINT08 lock_number;
extern UINT08 time_ov3;

void delay_us(UINT16 kk);
void Read_Address_IO(void);
void Channe_driver(void);
void Input_channe(void);
void Out_RS485EN(void);
void Read_addr_code(void);

void Read_channes1_8state(UINT08 data0,UINT08 data1);
void Read_channes9_16state(UINT08 data2,UINT08 bai1);
void Read_channes17_24state(UINT08 data3,UINT08 bai2);
void Read_channes25_30state(UINT08 data4,UINT08 bai3);


void Read_open_lock(void);
#endif
